/////////////////////////////////////////////////////////////////////////////
// Name:        tts_mp3settingsdialog.cpp
// Purpose:     
// Author:      Julian Smart
// Modified by: 
// Created:     20/02/2009 15:42:53
// RCS-ID:      
// Copyright:   (c) Anthemion Software Limited
// Licence:     New BSD License
/////////////////////////////////////////////////////////////////////////////

#include "wx/wx.h"

////@begin includes
////@end includes

#include "tts/tts_mp3settingsdialog.h"

////@begin XPM images
////@end XPM images


/*
 * wxTTSMP3SettingsDialog type definition
 */

IMPLEMENT_DYNAMIC_CLASS( wxTTSMP3SettingsDialog, wxDialog )


/*
 * wxTTSMP3SettingsDialog event table definition
 */

BEGIN_EVENT_TABLE( wxTTSMP3SettingsDialog, wxDialog )

////@begin wxTTSMP3SettingsDialog event table entries
////@end wxTTSMP3SettingsDialog event table entries

END_EVENT_TABLE()


/*
 * wxTTSMP3SettingsDialog constructors
 */

wxTTSMP3SettingsDialog::wxTTSMP3SettingsDialog()
{
    Init();
}

wxTTSMP3SettingsDialog::wxTTSMP3SettingsDialog( const wxMP3EncoderInfo& info, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
    Init();
    Create(info, parent, id, caption, pos, size, style);
}


/*
 * wxTTSMP3SettingsDialog creator
 */

bool wxTTSMP3SettingsDialog::Create( const wxMP3EncoderInfo& info, wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
{
#ifdef __WXMAC__
    SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#endif

////@begin wxTTSMP3SettingsDialog creation
    SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
    wxDialog::Create( parent, id, caption, pos, size, style );

    CreateControls();
    if (GetSizer())
    {
        GetSizer()->SetSizeHints(this);
    }
    Centre();
////@end wxTTSMP3SettingsDialog creation

    m_mp3SettingsPanel->SetInfo(info);

    return true;
}


/*
 * wxTTSMP3SettingsDialog destructor
 */

wxTTSMP3SettingsDialog::~wxTTSMP3SettingsDialog()
{
////@begin wxTTSMP3SettingsDialog destruction
////@end wxTTSMP3SettingsDialog destruction
}


/*
 * Member initialisation
 */

void wxTTSMP3SettingsDialog::Init()
{
////@begin wxTTSMP3SettingsDialog member initialisation
    m_lameIntroCtrl = NULL;
    m_mp3SettingsPanel = NULL;
////@end wxTTSMP3SettingsDialog member initialisation
}


/*
 * Control creation for wxTTSMP3SettingsDialog
 */

void wxTTSMP3SettingsDialog::CreateControls()
{    
////@begin wxTTSMP3SettingsDialog content construction
    wxTTSMP3SettingsDialog* itemDialog1 = this;

    wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
    itemDialog1->SetSizer(itemBoxSizer2);

    wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxVERTICAL);
    itemBoxSizer2->Add(itemBoxSizer3, 1, wxGROW|wxALL, 5);

    wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("MP3 settings"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStaticText4->SetFont(wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetPointSize(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetFamily(), wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT).GetStyle(), wxBOLD, false, wxT("")));
    itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALL, 5);

    m_lameIntroCtrl = new wxStaticText( itemDialog1, wxID_STATIC, _("Configure MP3 creation settings here, for converting WAV files into MP3 files using the LAME converter.\n\nPlease note that MP3 encoding is patented and you should be aware of licensing issues before using LAME."), wxDefaultPosition, wxDefaultSize, 0 );
    m_lameIntroCtrl->Wrap(400);
    itemBoxSizer3->Add(m_lameIntroCtrl, 0, wxALIGN_LEFT|wxALL, 5);

    m_mp3SettingsPanel = new wxTTSMP3SettingsPanel( itemDialog1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
    itemBoxSizer3->Add(m_mp3SettingsPanel, 1, wxGROW|wxALL, 5);

    wxStdDialogButtonSizer* itemStdDialogButtonSizer7 = new wxStdDialogButtonSizer;

    itemBoxSizer2->Add(itemStdDialogButtonSizer7, 0, wxGROW|wxALL, 5);
    wxButton* itemButton8 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStdDialogButtonSizer7->AddButton(itemButton8);

    wxButton* itemButton9 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
    itemStdDialogButtonSizer7->AddButton(itemButton9);

    itemStdDialogButtonSizer7->Realize();

////@end wxTTSMP3SettingsDialog content construction
}


/*
 * Should we show tooltips?
 */

bool wxTTSMP3SettingsDialog::ShowToolTips()
{
    return true;
}

/*
 * Get bitmap resources
 */

wxBitmap wxTTSMP3SettingsDialog::GetBitmapResource( const wxString& name )
{
    // Bitmap retrieval
////@begin wxTTSMP3SettingsDialog bitmap retrieval
    wxUnusedVar(name);
    return wxNullBitmap;
////@end wxTTSMP3SettingsDialog bitmap retrieval
}

/*
 * Get icon resources
 */

wxIcon wxTTSMP3SettingsDialog::GetIconResource( const wxString& name )
{
    // Icon retrieval
////@begin wxTTSMP3SettingsDialog icon retrieval
    wxUnusedVar(name);
    return wxNullIcon;
////@end wxTTSMP3SettingsDialog icon retrieval
}
